<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<title>彩种开奖管理</title>
<%@include file="/WEB-INF/base.jspf"%>
<style>
#test1 {
	margin: 2px;
	height: 37px;
}
	.modal-dialog {
		max-width: 1000px;
	}
#test2 {
	margin: 2px;
	height: 37px;
}

#qblx {
	margin: 2px;
	height: 37px;
}

.bjlRoomId{
	height: 37px;
    margin-top: 2px;
}

#zflx {
	margin: 2px;
	height: 37px;
}

.layui-inline {
	height: 100px;
}

#hymc {
	margin: 2px;
	height: 37px;
}

.layui-inline-dd {
	margin-top: 40px;
}

#hymc-qihao {
	height: 37px;
	margin-top: 2px;
}

.dataTables_length {
	margin-top: 12px;
	margin-left: 50px;
}

.tableSearch {
	position: relative;
}

.class-span-searchBtn {
	height: 24px;
	width: 36px;
	font-size: 14px;
	text-algin: center;
	line-height: 25px;
	padding: 0 !important;
	position: absolute;
	right: 20px;
	top: 12px;
}

.class-input-pageNumber {
	width: 40px;
	height: 23px;
	position: absolute;
	right: 58px;
	top: 12px;
}

#table_id_example_paginate {
	margin-right: 100px;
}

.class-th {
	width: 320px;
	text-align: center;
}
.nav-fake {
padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}
.nav-tabs-fake>li {
float: left;
    margin-bottom: -1px;
}
.nav-fake>li {
position: relative;
    display: block;	
}
.nav-tabs-fake>li.active>a {
color: #555;
    cursor: default;
    background-color: #fff;
    border: 1px solid #ddd;
    border-bottom-color: transparent;	
}
.nav-tabs-fake>li>a {
margin-right: 2px;
    line-height: 1.42857143;
    border: 1px solid transparent;
    border-radius: 4px 4px 0 0;	
}
.nav-fake>li>a {
position: relative;
    display: block;
    padding: 10px 15px;	
}
.nav-tabs-fake:after {
	content:"";
	display:block;
	clear:both;
}
table th,table tr,table td {
text-align: center;
vertical-align:middle;
}

.roomCard{
	margin-left: 5px;
	margin-right: 10px;
}

.pukeCard{ 
    width: 30px;
    border: 1px solid #666;
    height: 40px;
}
</style>
</head>
<body class="layui-layout-body">
	<div>
		<div class="">
				<!-- <p style="color: red;"></p> -->
				<ul class="nav-fake nav-tabs-fake">
					<c:forEach items="${lottery}" var="lottery" varStatus="index">
						<li><a href="#identifier">${lottery.name }</a></li>
					</c:forEach>
				</ul>
			<form id="form-i-placeholderForm">
			<div>
				<input type="text" id="test2" data-search name="date1" placeholder="开始时间" value="">
				<input type="text" id="hymc-qihao" data-search name="period" placeholder="开奖期号">
				<button type="button" class="layui-btn layui-btn-radius" id="button-i-searchTableContent">查询</button>
				<button type="button" class="layui-btn layui-btn-radius" id="button-i-resetTableContent">重置</button>				
			</div>
			<div>
				<input type="text" name="date2" data-search id="test1"placeholder="结束时间" value="">
				<span class="roomCard" style="display: none;">房间桌号：</span>
				<select class='bjlRoomId' style="display: none;">
					<option>全部</option>
					<option>第一桌</option>
					<option>第二桌</option>
					<option>第三桌</option>
					<option>第四桌</option>
					<option>第五桌</option>
					<option>第六桌</option>
				</select>
			</div>
			</form>
		</div>
		<div style="display:flex;justify-content:flex-end;">
			<button class="btn btn-lg btn-primary refund" data-toggle="modal" data-target="#tuikuanModal">一键退款</button>
		</div>
		<div class="layui-inline-dd">
			<table
				class="class-tableDataTable class-table-needClick display table table-striped table-bordered table-hover"
				id="table_id_example">
				<thead>
					<tr class='table_id_header'>
						 <th class="class-th">期号</th>
						<th class="class-th">开奖号码</th>
						<th class="class-th">开奖状态</th>
						<th class="class-th">开奖时间</th>
						<th class="class-th">派奖时间</th>
						<th class="class-th">投注状态</th> 
					</tr>
				</thead>
				<tbody>
				</tbody>
			</table>
			
			<table
				class="class-tableDataTable class-table-needClick display table table-striped table-bordered table-hover"
				id="table_id_bjl" style="display:none;">
				<thead>
					<tr class='table_id_header'>
						<th class='class-th'>期号</th>
						<th class='class-th'>庄1牌</th>
						<th class='class-th'>庄2牌</th>
						<th class='class-th'>庄补牌</th>
						<th class='class-th'>闲1牌</th>
						<th class='class-th'>闲2牌</th>
						<th class='class-th'>闲补牌</th>
						<th class='class-th'>赢家</th>
						<th class='class-th'>开奖状态</th>
						<th class='class-th'>开奖时间</th>
						<th class='class-th'>派奖时间</th>
						<th class='class-th'>桌号</th> 
					</tr>
				</thead>
				<tbody>
				</tbody>
			</table>
		</div>
	</div>
	
	<div class="modal fade" id="tuikuanModal" tabindex="-1" role="dialog" aria-labelledby="tuikuanModal" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="myModalLabel">一键退款</h4>
            </div>
            <div class="modal-body">
            	<p style="display:flex;align-items:center;"><span style="width:80px;display:inline-block;">异常期号：</span><input required class="form-control input-c-qihaoValue" style="width:auto;flex-grow:1;" /></p>
            	<p style="display:flex;align-items:center;"><span style="width:80px;display:inline-block;">异常彩种：</span>
            		<select required style="width:auto;flex-grow:1;" class="form-control select-c-chooseCaiZhong">
            			<c:forEach items="${lottery}" var="lottery" varStatus="index">
            			<option value="${lottery.cname}">${lottery.name }</option>
						</c:forEach>
            		</select>
            	</p>
            	<p class='roomNumbers' style="display:none;align-items:center;"><span style="width:80px;display:inline-block;">房间号：</span>
            		<select required style="width:auto;flex-grow:1;" class="form-control select-c-chooseKaiJiangRoomId">
            			<option value="1">第一桌</option>
            			<option value="2">第二桌</option>
            			<option value="3">第三桌</option>
            			<option value="4">第四桌</option>
            			<option value="5">第五桌</option>
            			<option value="6">第六桌</option>
            		</select>
            	</p>
             	<p style="display:flex;align-items:center;"><span style="width:80px;display:inline-block;">开奖类型：</span>
            		<select required style="width:auto;flex-grow:1;" class="form-control select-c-chooseKaiJiangLeiXing">
            			<option value="官方开奖异常">官方开奖异常</option>
            			<option value="平台开奖异常">平台开奖异常</option>
            		</select>
            	</p>           	
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-danger" id="button-i-tuikuanBtn">确认退款</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div>
	
	
<div class="modal fade" id="noticeModal" tabindex="-1" role="dialog" aria-labelledby="noticeModal" aria-hidden="true">
    <div class="modal-dialog class-fake-alert">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            </div>
            <div class="modal-body" ></div>
            <div class="modal-footer">	      
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>	
	
	<script type="text/javascript" src="/js/zhengzeTools.js"></script>
	<script>
	var cname='bjpk10'
	var roomNumber=""
    var cp ={
	    	'北京PK拾':'bjpk10',
	    	'二分PK拾':'2fpk10',
	    	'幸运飞艇':'xyft',
	    	'幸运赛马':'xysm',
	    	'二分飞艇':'2fft',
	    	'重庆时时彩':'cqssc',
	    	'二分时时彩':"2fssc",
	    	'天津时时彩':'tjssc',
	    	'新疆时时彩':'xjssc',
	    	'北京28':'bj28',
	    	'幸运28':'xy28',
	    	'广东快乐十分':'gdkl10f',
	    	'重庆快乐十分':'cqkl10f',
	    	'安徽11选5':'ah11x5',
	    	'广东11选5':'gd11x5',
	    	'江西11选5':'jx11x5',
	    	'山东11选5':'sd11x5',
	    	'上海11选5':'sh11x5',
	        '香港六合彩':'xg6hc',
	        '上海时时乐':'shssl',
	        '排列三':'pl3',
	        '福彩3D':'fc3d',
	        '安徽快3':'ahk3',
	        '广西快3':'gxk3',
	        '江苏快3':'jsk3',
	        '北京快3':'bjk3',
	        '吉林快3':'jlk3',
	        '三分快3':'3fk3',
	        '二分快3':'2fk3',
	        '快乐扑克':'klpk',
	        '百家乐':'bjl',
	      } 	
	document.querySelectorAll(".nav-tabs-fake li")[0].classList.add("active")
		layui.use('laydate', function() {
			var laydate = layui.laydate;
			laydate.render({
				elem : '#test1' //指定元素
			});
			laydate.render({
				elem : '#test2' //指定元素
			});
		});
		
		$('#identifier a').click(function (e) {
			  e.preventDefault()
			  $('#myTab li:eq(0) a').tab('show')
			})
			
		$(function(){
	      $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
	      var activeTab = $(e.target).text(); 
	      var previousTab = $(e.relatedTarget).text(); 
	      $(".active-tab span").html(activeTab);
	      $(".previous-tab span").html(previousTab);
		});
	   });
		
		 function dataTable01(){
				var oTable=	$("#table_id_example").DataTable({
						 "bProcessing" : false, // 是否显示取数据时的那个等待提示
						"bServerSide" : true,//这个用来指明是通过服务端来取数据
						 "bPaginate" : true, //是否显示分页 
						"sAjaxSource" : "/czgl/findByCnameCheckRecord.do",//这个是请求的地址
						"fnServerData" : retrieveData, // 获取数据的处理函数
						"destroy":true,
					      // "bPaginate": true,
					       "bLengthChange": true,      
					      "bSort": false,
					      // "bInfo": true,
					      "bAutoWidth": false,
//					         "bServerSide":true,
					      'aLengthMenu':[5,10, 20], 
					       "searching": false,  
					        "pagingType": "simple_numbers",
					      "dom": "t<'tableinfo'i<'tableSearch'p>l>",   
					     
					       
					       "language": {//语言设置  
					            "lengthMenu": "每页显示 _MENU_ 条记录",     
					            "zeroRecords": "没有检索到数据",     
					            "sInfo": "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录",     
					            "info": "没有数据",     
					            "oPaginate": {     
					                "sFirst": "首页",     
					                "sPrevious": "前一页",     
					                "sNext": "后一页",     
					                "sLast": "尾页"    
					          	},
					            "search":"",
					            "searchPlaceholder": "请输入关键字",
					            "infoFiltered":   "(从  _MAX_ 记录中搜索出结果)",
					            "infoEmpty":      "没有找到匹配的信息",
					         }, 
					         "columnDefs": [{"defaultContent": "",
	                              "targets": "_all"}],
					         "columns": [
			                     { "data": "period" },
			                     { "data": "lotternumber" },
			                     { "data": "state" },
			                     { "data": "lottertime" },
			                     { "data": "paijtime" },
			                     { "data": "touzhuzt" },
			                 ],	
					})
		
		function retrieveData(sSource, aoData, fnCallback) {
					$.ajax({
						url : sSource,//这个就是请求地址对应sAjaxSource
						data : {
							"pageCount":aoData[0].value,
							"startIndex":aoData[3].value,
							"lineCount":aoData[4].value,
							"cname":cname,
						},//这个是把datatable的一些基本数据传给后台,比如起始位置,每页显示的行数
						type : 'post',
						dataType : 'json',
						async : false,
						success : function(result) { 
							fnCallback(result);//把返回的数据传给这个方法就可以了,datatable会自动绑定数据的
						},
						error : function(msg) {
						}
					});
				}
			}

		 dataTable01();
		 
		 insertSearchBtn()			
			$("#button-i-resetTableContent").on("click", function(event) {
				$("#test2").val("")
				$("#test1").val("")
				$("#hymc-qihao").val("")
				$(".bjlRoomId").val("全部")
				if($(".active").find("a").text()!='百家乐'){
					dataTable01()	
				}else{
					dataTable02()
				}
			})
			
			$(".select-c-chooseCaiZhong").change(function(){
				if($(".select-c-chooseCaiZhong").val()=="bjl"){
					$(".roomNumbers")[0].style.display="flex";
				}else{
					$(".roomNumbers")[0].style.display="none";
				}
			})
					$("#button-i-tuikuanBtn").on("click",function(){
						if($(".select-c-chooseCaiZhong").val()=="bjl"){
						var roomId=$(".select-c-chooseKaiJiangRoomId").val();
						if($(".input-c-qihaoValue").val()==""){
							return;
						}
						$.ajax({
							url : "/bjlhtgl/baccaratRefund.do",//这个就是请求地址对应sAjaxSource
							data : {
								tableNumber:roomId,
								issueNumber:$(".input-c-qihaoValue").val(),
							},//这个是把datatable的一些基本数据传给后台,比如起始位置,每页显示的行数
							type : 'post',
							dataType : 'json',
							async : false,
							success : function(result) { 
								$("#tuikuanModal").modal("hide")
								if(result.data==0){  /* 参数填写不完整 */
									showNoticeModal("参数填写不完整")
								}if(result.data==1){/* 已经开奖无法进行退款 */
									showNoticeModal("已经开奖无法进行退款")
								}if(result.data==2){/* 退款成功 */
									showNoticeModal("退款成功")
								}if(result.data==3){/* 没有要退款的 */
									showNoticeModal("当前没有要退款的用户!")
								}
							},
							error : function(msg) {
							}
						});
						}
					})
			$("#button-i-searchTableContent").on("click", function(event) {
				if($(".active").find("a").text()!='百家乐'){
				if($("#test2").val()=="" && $("#hymc-qihao").val()=="" && $("#test1").val()=="") {
					 return 
				 }	
				else{
					var oTable=	$("#table_id_example").DataTable({
						 "bProcessing" : false, // 是否显示取数据时的那个等待提示
						"bServerSide" : true,//这个用来指明是通过服务端来取数据
						 "bPaginate" : true, //是否显示分页 
						"sAjaxSource" : "/czgl/likeFindByConditionCheckRecord.do",//这个是请求的地址
						"fnServerData" : retrieveData, // 获取数据的处理函数
						"destroy":true,
					      // "bPaginate": true,
					       "bLengthChange": true,      
					      "bSort": false,
					      // "bInfo": true,
					      "bAutoWidth": false,
//					         "bServerSide":true,
					      'aLengthMenu':[5,10, 20], 
					       "searching": false,  
					       "language": {//语言设置  
					            "lengthMenu": "每页显示 _MENU_ 条记录",     
					            "zeroRecords": "没有检索到数据",     
					            "sInfo": "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录",     
					            "info": "没有数据",     
					            "oPaginate": {     
					                "sFirst": "首页",     
					                "sPrevious": "前一页",     
					                "sNext": "后一页",     
					                "sLast": "尾页"    
					          	},
					            "search":"",
					            "searchPlaceholder": "请输入关键字",
					            "infoFiltered":   "(从  _MAX_ 记录中搜索出结果)",
					            "infoEmpty":      "没有找到匹配的信息",
					         },  
					         "columnDefs": [{"defaultContent": "",
	                              "targets": "_all"}],
					         "columns": [
			                     { "data": "period" },
			                     { "data": "lotternumber" },
			                     { "data": "state" },
			                     { "data": "lottertime" },
			                     { "data": "paijtime" },
			                     { "data": "touzhuzt" },
			                 ],	
					})
			
		function retrieveData(sSource, aoData, fnCallback) {
					$.ajax({
						url : sSource,//这个就是请求地址对应sAjaxSource
						data : {
							"pageCount":aoData[0].value,
							"startIndex":aoData[3].value,
							"lineCount":aoData[4].value,
							"period":$("#hymc-qihao").val(),
							"cname":cname,
							"date1":$("#test2").val(),
							"date2":$("#test1").val(),
						},//这个是把datatable的一些基本数据传给后台,比如起始位置,每页显示的行数
						type : 'post',
						dataType : 'json',
						async : false,
						success : function(result) { 
							fnCallback(result);//把返回的数据传给这个方法就可以了,datatable会自动绑定数据的
						},
						error : function(msg) {
						}
					});
				}
			}
			}else{
				if($(".bjlRoomId").val()=="第一桌"){
					roomNumber="1"
				}if($(".bjlRoomId").val()=="第二桌"){
					roomNumber="2"
				}if($(".bjlRoomId").val()=="第三桌"){
					roomNumber="3"
				}if($(".bjlRoomId").val()=="第四桌"){
					roomNumber="4"
				}if($(".bjlRoomId").val()=="第五桌"){
					roomNumber="5"
				}if($(".bjlRoomId").val()=="第六桌"){
					roomNumber="6"
				}if($(".bjlRoomId").val()=="全部"){
					roomNumber=""
				}
				dataTable02()
			}
			})	
			
			$(".nav-tabs-fake li").on("click", function(event) {
				$(".nav-fake .active").removeClass("active")
				event.currentTarget.classList.add("active")
				cname=cp[$(this).find("a").text()]
				if(cname!='bjl'){
					$(".roomCard").hide();
					$(".bjlRoomId").hide();
					$("#table_id_example_wrapper").show();
					$("#table_id_bjl_wrapper").hide();
					var table = $('#table_id_example').DataTable();
					var oTable=	$("#table_id_example").DataTable({
					 "bProcessing" : false, // 是否显示取数据时的那个等待提示
					"bServerSide" : true,//这个用来指明是通过服务端来取数据
					 "bPaginate" : true, //是否显示分页 
					"sAjaxSource" : "/czgl/findByCnameCheckRecord.do",//这个是请求的地址
					"fnServerData" : retrieveData, // 获取数据的处理函数
					"destroy":true,
				      // "bPaginate": true,
				       "bLengthChange": true,      
				      "bSort": false,
				      // "bInfo": true,
				      "bAutoWidth": false,
//				         "bServerSide":true,
				      'aLengthMenu':[5,10, 20], 
				       "searching": false,  
				      /*  "pagingType": "simple_numbers",
				       "dom": "t<'tableinfo'i<'tableSearch'p>l>",  */
				       
				       "language": {//语言设置  
				            "lengthMenu": "每页显示 _MENU_ 条记录",     
				            "zeroRecords": "没有检索到数据",     
				            "sInfo": "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录",     
				            "info": "没有数据",     
				            "oPaginate": {     
				                "sFirst": "首页",     
				                "sPrevious": "前一页",     
				                "sNext": "后一页",     
				                "sLast": "尾页"    
				          	},
				            "search":"",
				            "searchPlaceholder": "请输入关键字",
				            "infoFiltered":   "(从  _MAX_ 记录中搜索出结果)",
				            "infoEmpty":      "没有找到匹配的信息",
				         },  
				         "columns": [
		                     { "data": "period" },
		                     { "data": "lotternumber" },
		                     { "data": "state" },
		                     { "data": "lottertime" },
		                     { "data": "paijtime" },
		                     { "data": "touzhuzt" },
		                 ],	
				})

	function retrieveData(sSource, aoData, fnCallback) {
				$.ajax({
					url : sSource,//这个就是请求地址对应sAjaxSource
					data : {
						"pageCount":aoData[0].value,
						"startIndex":aoData[3].value,
						"lineCount":aoData[4].value,
						"cname":cname,
					},//这个是把datatable的一些基本数据传给后台,比如起始位置,每页显示的行数
					type : 'post',
					dataType : 'json',
					async : false,
					success : function(result) { 
						fnCallback(result);//把返回的数据传给这个方法就可以了,datatable会自动绑定数据的
					},
					error : function(msg) {
					}
				});
			}
		}else{
			$("#table_id_example_wrapper").hide();
			$("#table_id_bjl").show();
			$(".roomCard").show();
			$(".bjlRoomId").show();
			dataTable02()
		}			
	})
			var obj2 = {
					btnName: "#button-i-tuikuanBtn",
					divName: "#tuikuanModal",
					isRegArray: [
		             {
		            	 regValue: /^[0-9]+$/,
		            	 inputValue: function() {
		            		 return $(".input-c-qihaoValue").val()
		            	 },
		            	 noticeText: "期号必须由纯数字组成",
		             }
	               ],					
			}
			 
			checkFormMethod(obj2, function() {
				if($(".select-c-chooseCaiZhong").val()=='bjl'){
					return;
				}
				var newRequest = {
					type: "post",
					url: "/czgl/oneClickUserRefund.do",
					data: {
						period: $(".input-c-qihaoValue").val(),
						cname: $(".select-c-chooseCaiZhong").val(),
						lotternumber: $(".select-c-chooseKaiJiangLeiXing").val(),
						cnams:$(".select-c-chooseCaiZhong").find("option:selected").text(),
					},
					success: function(data) {
						var newData = JSON.parse(data)
						
						$("#tuikuanModal").modal("hide")
						showNoticeModal(newData.message)
					},
					error: function(status) {
					}
				}
				ajax(newRequest)
			})	
				
			
			
		 function dataTable02(){
			 var oTable=	$("#table_id_bjl").DataTable({
				 "bProcessing" : false, // 是否显示取数据时的那个等待提示
				"bServerSide" : true,//这个用来指明是通过服务端来取数据
				 "bPaginate" : true, //是否显示分页 
				"sAjaxSource" : "/bjlhtgl/lotteryRecord.do",//这个是请求的地址
				"fnServerData" : retrieveData, // 获取数据的处理函数
				"destroy":true,
			      // "bPaginate": true,
			       "bLengthChange": true,      
			      "bSort": false,
			      // "bInfo": true,
			      "bAutoWidth": false,
//			         "bServerSide":true,
			      'aLengthMenu':[5,10, 20], 
			       "searching": false,  
			      /*  "pagingType": "simple_numbers",
			       "dom": "t<'tableinfo'i<'tableSearch'p>l>",  */
			       
			       "language": {//语言设置  
			            "lengthMenu": "每页显示 _MENU_ 条记录",     
			            "zeroRecords": "没有检索到数据",     
			            "sInfo": "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录",     
			            "info": "没有数据",     
			            "oPaginate": {     
			                "sFirst": "首页",     
			                "sPrevious": "前一页",     
			                "sNext": "后一页",     
			                "sLast": "尾页"    
			          	},
			            "search":"",
			            "searchPlaceholder": "请输入关键字",
			            "infoFiltered":   "(从  _MAX_ 记录中搜索出结果)",
			            "infoEmpty":      "没有找到匹配的信息",
			         },  
			         "columnDefs": [{"defaultContent": "",
                         "targets": "_all"}],
			         "columns": [
	                     { "data": "issueNumber" },
	                     { "data": "zhuang1" },
	                     { "data": "zhuang2" },
	                     { "data": "dealerCard" },
	                     { "data": "leisure1" },
	                     { "data": "leisure2" },
	                     { "data": "leisureCard" },
	                     { "data": "winner" },
	                     { "data": "state" },
	                     { "data": "openingTimeOfTheCurrentAward" },
	                     { "data": "time" },
	                     { "data": "tableNumber" },
	                 ],	
			})

function retrieveData(sSource, aoData, fnCallback) {
			$.ajax({
				url : sSource,//这个就是请求地址对应sAjaxSource
				data : {
					"pageCount":aoData[0].value,
					"startIndex":aoData[3].value,
					"lineCount":aoData[4].value,
					"time1":$("#test2").val(),
					"time2":$("#test1").val(),
					"period":$("#hymc-qihao").val(),
					"tableNumber":roomNumber,
				},//这个是把datatable的一些基本数据传给后台,比如起始位置,每页显示的行数
				type : 'post',
				dataType : 'json',
				async : false,
				success : function(result) { 
					var newJson = result.aaData
	        		 for (var i = 0; i < newJson.length; i++) {
	         			 var item = newJson[i]
	         			 if(item.state==1){
	         				item.state="已开奖"
	         			 }if(item.state==0){
	         				item.state="未开奖"
	         			 }if(item.state==2){
	         				item.state="已预设"
	         			 }
	         			 
	         			 if(item.winner==0){
	         				item.winner="闲赢"
	         			 } if(item.winner==1){
	         				item.winner="庄赢"
	         			 } if(item.winner==2){
	         				item.winner="和局"
	         			 }
	         			 
	         			 if(item.leisureCard!=undefined){
	         				item.leisureCard="<img class='pukeCard'  src='/img/caizhong/bjl/" + item.leisureCard + ".png'>"
	         			 }if(item.dealerCard!=undefined){
	         				item.dealerCard="<img class='pukeCard'  src='/img/caizhong/bjl/" + item.dealerCard + ".png'>"
	         			 }
	         			 item.zhuang1="<img class='pukeCard'  src='/img/caizhong/bjl/" + item.zhuang1 + ".png'>"
	         			 item.zhuang2="<img class='pukeCard' src='/img/caizhong/bjl/" + item.zhuang2 + ".png'>"
	         			 item.leisure1="<img class='pukeCard' src='/img/caizhong/bjl/" + item.leisure1 + ".png'>"
	         			 item.leisure2="<img class='pukeCard' src='/img/caizhong/bjl/" + item.leisure2 + ".png'>"
	        		 }
					 result.aaData = newJson; 
					fnCallback(result);//把返回的数据传给这个方法就可以了,datatable会自动绑定数据的
				},
				error : function(msg) {
				}
			});
		}
	 }
			
	</script>
</body>
</html>